home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 21 / Cream of the Crop 21 (Terry Blount) (October 1996).iso / program / oxcc1434.zip / SRC / OXCC.H < prev    next >
C/C++ Source or Header  |  1996-09-03  |  5KB  |  153 lines

  1. /* 
  2.     oxcc.h -- header file for Oxbow C compiler
  3.  
  4.     Copyright (c) 1995
  5.     Norman D. Culver dba
  6.     Oxbow Software
  7.     1323 S.E. 17th Street #662
  8.     Ft. Lauderdale, FL 33316
  9.     (954) 463-4754
  10.     ndc@icanect.net
  11.     All rights reserved.
  12.  
  13.  * Redistribution and use in source and binary forms are permitted
  14.  * provided that: (1) source distributions retain this entire copyright
  15.  * notice and comment, and (2) distributions including binaries display
  16.  * the following acknowledgement:  ``This product includes software
  17.  * developed by Norman D. Culver dba Oxbow Software''
  18.  * in the documentation or other materials provided with the distribution
  19.  * and in all advertising materials mentioning features or use of this
  20.  * software.
  21.  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
  22.  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  23.  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  24.  
  25. */
  26. #ifdef __cplusplus
  27. extern "C" {
  28. #endif
  29.  
  30. /* debug bits */
  31. #define dA    (0x00000001)    /* DEBUG_STRUCT_ELEMS */
  32. #define dB    (0x00000002)    /* DEBUG_ASSIGNMENT */
  33. #define dC    (0x00000004)    /* DEBUG_GETVAL */
  34. #define dD    (0x00000008)    /* DEBUG_ABSOLUTE_ADDR */
  35. #define dE    (0x00000010)    /* DEBUG_POINTER_BUMPS */
  36. #define dF    (0x00000020)    /* DEBUG_INITTED */
  37. #define dG    (0x00000040)    /* DEBUG_SHADOW */
  38. #define dH    (0x00000080)    /* DEBUG_CAST */
  39. #define dI    (0x00000100)    /* DEBUG_CMS */
  40. #define dJ    (0x00000200)    /* DEBUG_DEREF */
  41. #define dK    (0x00000400)    /* DEBUG_SETJMP */
  42. #define dL    (0x00000800)    /* DEBUG_CALLBACKS */
  43. #define dM    (0x00001000)    /* DEBUG_GROSS */
  44. #define dN    (0x00002000)    /* DEBUG_BLOB */
  45. #define dO    (0x00004000)    /* DEBUG_RINITS */
  46. #define dP    (0x00008000)    /* DEBUG_RUNSTACK */
  47. #define dQ    (0x00010000)    /* DEBUG_STMT_TRACE */
  48. #define dR    (0x00020000)    /* DEBUG_RUNCALLS */
  49. #define dS    (0x00040000)    /* DEBUG_PURGE */
  50. #define dT    (0x00080000)
  51. #define dU    (0x00100000)
  52. #define dV    (0x00200000)
  53. #define dW    (0x00400000)
  54. #define dX    (0x00800000)
  55. #define dY    (0x01000000)
  56. #define dZ    (0x02000000)
  57.  
  58. /* NAME SPACES -- in the main symbol table */
  59. #define DATASPACE 0
  60. #define TAGSPACE 1
  61. #define MEMBERSPACE 2
  62. #define GOTOSPACE 3
  63. #define USEDSPACE 4
  64. #define LOCALSPACE 5
  65. #define KEEPERSPACE 6
  66. #define SUSPACE0 7
  67. #define SUSPACE1 8
  68. #define BSSPACE 9
  69. #define INITSPACE 10
  70. #define SEGSPACE 11
  71.  
  72. /* STRUCTURE FOR OPTIONS SETTING -- 16 bytes */
  73. typedef struct _oxccopts {
  74.     char code_format;
  75.     char target_hardware;
  76.     char target_debugger;
  77.     char target_os;
  78.     char memory_model;
  79.     char obj_format;
  80.     char target_assembler;
  81.     char runcode;
  82.     char fastmode;
  83.     char quiet;
  84.     char warn_addr;
  85.     char ansi_mode;
  86.     char shroud;
  87.     char listing_wanted;
  88.     char unused[2];
  89.     char asciz;        /* should be zero to imitate a string */
  90. } OXCCOPTS;
  91.  
  92. /* callable functions */
  93. #ifndef __OXCCFUNCSH__
  94. #define __OXCCFUNCSH__
  95. extern void oxcc_proc_syms(void *iv, unsigned namespace, void (*func)());
  96. /* func(AsTP node, int symb, void *container) */
  97.  
  98. extern void oxcc_proc_ptr_info(void *iv, void (*func)());
  99. /* func(void *addr, void *mino, void *maxo) */
  100.  
  101. extern void oxcc_proc_mallocs(void *iv, void (*func)());
  102. /* func(void *loc, int size, DATUM *ip) */
  103.  
  104. extern int oxcc(int argc, char **argv);
  105. extern void *oxcc_get_pg(void *iv);
  106. extern void oxcc_debug(void *iv, int flags);
  107. extern void oxcc_enable_trace(void *iv);
  108. extern void oxcc_disable_trace(void *iv);
  109.  
  110. extern void *oxcc_open_instance(void);
  111. extern void oxcc_set_options(void *iv, char *opts);
  112. extern int oxcc_preproc_file(void *iv, void *is, void *os, void *es,
  113.                                 int argc, char **argv);
  114. extern int oxcc_parse_file(void *iv, void *is, void *es, char *filename);
  115. extern void oxcc_print_parse_errors(void *iv, void *es);
  116. extern int oxcc_check_ast_tree(void *iv, void *es, char *filename);
  117. extern int oxcc_init_outers(void *iv, void *es);
  118. extern int oxcc_run_tree(void *iv, void *es, char *filename, 
  119.                                 char *argstring, char *startfunc);
  120. extern int oxcc_gen_code(void *iv, void *es, char *filename, void *os);
  121. extern void oxcc_cleanup_parse(void *iv);
  122. extern void oxcc_close_codefile(void *iv);
  123. extern void oxcc_close_instance(void *iv);
  124.  
  125. extern void oxcc_print_ast(void *iv, void *os, int flag);
  126. extern void *oxcc_get_ast_root(void *iv);
  127. extern int oxcc_eval_expr(void *iv, void *buf, double *result, void *es);
  128. extern void *__builtin_iv(void);
  129. extern void *__builtin_pg(void);
  130. #endif /* __OXCCFUNCSH__ */
  131.  
  132. #ifndef __OXCCCLASS__
  133. #define __OXCCCLASS__
  134. extern void gSetup(void *self, void *str);
  135. extern int gPreProc(void *self, void *is, void *os, void *es, int argc, char **argv);
  136. extern int gParse(void *self, void *is, void *es, char *filename);
  137. extern void gPerror(void *self, void *es);
  138. extern int gCheckTree(void *self, void *es, char *filename);
  139. extern int gInitOuters(void *self, void *es);
  140. extern int gRunCode(void *self, void *es, char *filename, char *args);
  141. extern int gGenCode(void *self, void *es, void *os, char *filename);
  142. extern void gCleanup(void *self);
  143. extern void gCloseCode(void *self);
  144. extern void gPrtAst(void *self, void *es, int flag);
  145. extern void *gGetRoot(void *self);
  146. extern int gEval(void *self, void *buf, double *result, void *es);
  147. #endif /* __OXCCCLASS__
  148.  
  149. #ifdef __cplusplus
  150. }
  151. #endif
  152.  
  153.